package com.ddtech.framework.system.repository;

import com.ddtech.framework.system.model.SysRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Set;

/**
 * @author Apache License
 * @date 2018-12-03
 */
public interface RoleRepository extends JpaRepository<SysRole, String>, JpaSpecificationExecutor {

    /**
     * findByName
     * @param name
     * @return
     */
    SysRole findByName(String name);

    SysRole findByCode(String code);

    Set<SysRole> findByUsers_Id(String id);

    Set<SysRole> findByMenus_Id(String id);
}
